package edu.sctu.renpingan.IoPractice;

import java.io.File;
import java.io.IOException;

/**
 * Created by Administrator on 2015/6/14.
 */
public class Io {
    private static final String FILE_PATH = "E://more";
    private static final String NEW_TEXT_PATH = FILE_PATH+"//ren.txt";

    public void createNewFile(){
        File file = new File(FILE_PATH);
        if (!file.exists()){
            file.mkdir();
//            System.out.println(file.getName());
        }

    }
    public String createnewtext(){
        File file = new File(NEW_TEXT_PATH);
        if(!file.exists()){
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
//            System.out.println(file.getPath());
        }
        return file.getPath();
    }
    public String delete(){
        File file = new File(NEW_TEXT_PATH);
        file.delete();
        if(!file.exists()){
            System.out.println(file.getParent());
        }
        System.out.println("删除成功了");
        System.out.println(file.getPath()+"看路径");
        return file.getPath();
    }
}
